public class PersonHandler extends Thread {
	private SharedData sd;
	private int initial;
	private int target;

	public PersonHandler(SharedData sd) {
		this.sd = sd;
	}

	public void run() {
		while(true)	{
			// Sleep random time
			int delay = (int) (Math.random() * 46.0);
			
			try {
				Thread.sleep(delay*1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			do {
				initial = (int) (Math.random() * 7.0);
				target = (int) (Math.random() * 7.0);
			} while (initial == target);
			
			sd.callElevator(initial, target);
			
			
//		sd.updateEntry(initial);
//		sd.updateExit(target);
			
		}
		
		

	}

}
